<%@ taglib prefix="uthink" uri="/WEB-INF/tld/shiros.tld"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新发现服务管理</title>
</head>
<body>
	<nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>   <span class="c-gray en">&gt;</span>新发现服务管理 
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px" onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	<div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray"> 
			<span class="l"> 
			<a id="one" name="-1" class="btn btn-default title rleft def" href="<%=path%>/backstage/service_discover-list?aid=one">所有服务</a>
			<a id="two" name="1" class="btn btn-default title def" href="<%=path%>/backstage/service_discover-list?aid=two">即将开始</a>
			<a id="three" name="2" class="btn btn-default title def" href="<%=path%>/backstage/service_discover-list?aid=three">已结束</a>
			</span>
		 </div>

		 
		<div class="mt-20"></div>
		 
		<div class="cl pd-5 bg-1 bk-gray"> 
		<form action="<%=path%>/backstage/service_about_discover-list" method="get" class="form form-horizontal" id="search-form">
			<div class="text-c"> 
				<input type="hidden" id="aid" name="aid" value='${aid}' />
	   			<div class="row cl">
		   			<label class="form-label col-1">服务分类：</label>
					<div class="formControls col-2">
					<span class="select-box">
						<select name="cateId" class="select" >
							<option value="-1">----</option>
							<c:forEach items="${cates}" var="cate">
							<option value="${cate.id}" <c:if test="${cate.id==conditions.cate_id}">selected</c:if> >${cate.cate_name}</option>
							</c:forEach>
						</select>
					</span>
					</div>
					
					<label class="form-label col-1">服务名称：</label>
					<div class="formControls col-2">
						<input type="text" name="activity_name" value="${conditions.title}" id="activity_name" placeholder="服务名称" class="input-text col-2">
					</div>
					
					<label class="form-label col-1">状态：</label>
					<div class="formControls col-2">
					<span class="select-box">
						<select name="status" class="select" >
							<option value="-1">----</option>
							<option value="1" <c:if test="${1==conditions.status}">selected</c:if> >待审核</option>
						    <option value="2" <c:if test="${2==conditions.status}">selected</c:if> >已审核</option>
						    <option value="3" <c:if test="${3==conditions.status}">selected</c:if> >已驳回</option>
						    <option value="4" <c:if test="${4==conditions.status}">selected</c:if> >已开始</option>
						    <option value="5" <c:if test="${5==conditions.status}">selected</c:if> >已结束</option>
						    <option value="6" <c:if test="${6==conditions.status}">selected</c:if> >已取消</option>
						</select>
					</span>
					</div>

				<button name="" id="" class="btn btn-success f-r radius mr-20" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
				<div style="width:10px;height:5px;float:right;"></div>
					<button name="" onclick="theReset();" id="" class="btn btn-success" style="border-radius:5px;float:right;" >
						 重置
					</button>
				</div>
			</div>
		</form>
		</div>

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
                            <th width="80">服务名称</th>
                            
                            <th width="80">服务分类</th>
                            
                            <th width="80">发布时间</th>
                            
                            <th width="80">人数限制</th>
                            
                            <th width="80">开始时间</th>
                            
                            <th width="80">结束时间</th>
                            
                            <th width="80">状态</th>
                            
                            			<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${u_discovers}" var="u_discover">
						
						<tr class="text-c">
							<input type="hidden" id="id" name="id"
								value='${u_discover.id}' />
                                <td>${u_discover.title}</td>
                                
                                <td>${u_discover.cate_name}</td>
                                
                                <td>${u_discover.add_time}</td>
                                
                                <td>${u_discover.people_limit}</td>
                                
                                <td>${u_discover.begin_time}</td>
                                
                                <td>${u_discover.end_time}</td>
                                
                                <td><c:if test="${u_discover.status==1}">
                                	待审核
                                </c:if>
                                <c:if test="${u_discover.status==2}">
                                	已审核
                                </c:if>
                                <c:if test="${u_discover.status==3}">
                                	已驳回
                                </c:if>
                                <c:if test="${u_discover.status==4}">
                                	已开始
                                </c:if>
                                <c:if test="${u_discover.status==5}">
                                	已结束
                                </c:if>
                                <c:if test="${u_discover.status==6}">
                                	已取消
                                </c:if></td>

							<td class="td-manage">
								<c:if test="${u_discover.status==1 || u_discover.status==2}">
                                	<a class="btn btn-warning"
									onClick="u_discover_edit(this,'${u_discover.id}')" href="javascript:void(0);"
									title="编辑">编辑</a>
                                </c:if>
								
								&nbsp;&nbsp;&nbsp;&nbsp;
								<c:if test="${u_discover.status==1}">
									<a class="btn btn-primary"
									onClick="u_discover_verify(this,'${u_discover.id}')" href="javascript:void(0);"
									title="审核">审核</a>
								</c:if>
								<%-- 	&nbsp;&nbsp;&nbsp;&nbsp;
								<c:if test="${u_discover.status==2 || u_discover.status==3 || u_discover.status==5}">
									<a class="btn btn-primary"
									onClick="u_discover_cancel(this,'${u_discover.id}')" href="javascript:void(0);"
									title="取消">取消</a>
								</c:if>
									&nbsp;&nbsp;&nbsp;&nbsp;
								<c:if test="${u_discover.status==3 || u_discover.status==5 || u.discover.status==6}">
									<a class="btn btn-primary radius"
									onClick="u_discover_delete(this,'${u_discover.id}')" href="javascript:void(0);"
									title="删除">删除</a>
								</c:if> --%>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 0, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 1, 2 ]
				} // 制定列不参与排序
				]
			});
			var aid = document.getElementById("aid").value;
			if(aid == ''){
				var obj = document.getElementById('one');
				obj.className = "btn btn-default btn-warning title rleft def";
			}else{				
				var obj = document.getElementById(aid);
				obj.className = "btn btn-default btn-warning title rleft def";
			}
		});

		/*添加*/
		function u_discover_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		/*编辑*/
		function u_discover_edit(obj,id,w,h){
			var edit_page = "<%=path%>/backstage/u_service_discover-add-pre?id="+id;
			layer_show("编辑",edit_page,w,h);
		}

		function u_discover_verify(obj, id,w,h) {
			var verify_page = "<%=path%>/backstage/u_service_discover-verify?id="+id;
			layer_show("审核",verify_page,w,h);
		}
		
		
		
		/*取消*/
		function u_discover_cancel(obj,id){
			layer.confirm('确认取消？', {
				btn: ['确认','取消'], 
				shade: false
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/u_discover-cancel",
					data : "id=" + id,
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						layer.msg('已取消 ', {icon:6,time:1000});
						location.href ="<%=path%>/backstage/service_discover-list"; 
					}
				});
			},
			function(){
				layer.msg('未取消', {icon:5,time:1000});
			});	
		}
		
		
		
		/*删除*/
		function u_discover_delete(obj,id){
			layer.confirm('确认删除？', {
				btn: ['确认','取消'], 
				shade: false
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/u_discover-delete",
					data : "id=" + id,
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						layer.msg('已删除 ', {icon:6,time:1000});
						location.href ="<%=path%>/backstage/service_discover-list"; 
					}
				});
			},
			function(){
				layer.msg('未删除', {icon:5,time:1000});
			});	
		}
		
		
		
		/*
		重置
		*/
		function theReset(){
			$("#search-form input[type='text']").val('');
			$("#search-form select").val(-1);
		}
	</script>
</body>
</html>



